import { defineStore } from 'pinia';

export const useUserStore = defineStore('user', {
  state: () => ({
    realName: '',
    companyName: '宁波新乐电器有限公司',
    phoneNumber: '',
    avatar: '',
  }),
  actions: {
    setUserInfo() {
      this.realName = uni.getStorageSync('realName') || '';
      this.phoneNumber = uni.getStorageSync('phoneNumber') || '';
      this.avatar = uni.getStorageSync('avatar') || '';
    },
  },
});